import { UserLayout, WorkLayout, BlankLayout, AppLayout } from '@/components/layouts'

/**
 * 走菜单，走权限控制
 * @type {[null,null]}
 */
export const asyncRouterMap = [

  {
    path: '/',
    name: 'APP首页',
    component: AppLayout,
    meta: { title: '首页' },
    redirect: '/home/index',
    children: [
    ]
  },
  {
    path: '*', redirect: '/404', hidden: true
  }
]

/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [
  // process.env.NODE_ENV == 'production' ? {
  //   path: '/user',
  // } : 
  {
    path: '/user',
    component: UserLayout,
    redirect: '/user/login',
    hidden: true,
    children: [
      {
        path: 'login',
        name: 'login',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login')
      },

//      {
//        path: 'sso',
//        name: 'sso',
//        component: () => import(/* webpackChunkName: "user" */ '@/views/user/Sso')
//      }
    ]
  },

  {
    path: '/user/sso',
    name: 'sso',
    component: () => import(/* webpackChunkName: "user" */ '@/views/user/Sso')
  },

  {
    path: '/404',
    component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
  },

  {
    path: '/error',
    component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/error')
  },
  // 掌沃运营APP登陆
  {
    path: '/user/zwAppLogin',
    name: 'zwAppLogin',
    component: () => import(/* webpackChunkName: "user" */ '@/views/user/AppLogin')
  },

  // 掌沃通APP登陆
  {
    path: '/user/zwtAppLogin',
    name: 'zwtAppLogin',
    component: () => import(/* webpackChunkName: "user" */ '@/views/user/ZwtAppLogin')
  },
  {
    path: '/',
    name: 'APP首页',
    redirect: '/publicline/index',
  },
  {
    path: '/dashboard/analysis',
    name: 'APP首页',
    redirect: '/home/index',
  },
  {
    path: '/home',
    name: 'APP首页',
    component: AppLayout,
    meta: { title: '首页' },
    redirect: '/home/index',
    children: [
      {
        path: 'index',
        name: 'index',
        component: () => import('@/views/Index')
      },
    ]
  },

  {
    path: '/publicline',
    name: '小CEO首页',
    meta: { title: '首页' },
    component: BlankLayout,
    children: [
      // CEO工作台首页
      {
        path: '/publicline/index',
        meta: { title: '首页' },
        component: () => import('@/views/workbench/publicline/index')
      },
      // 纠偏工单
      {
        path: '/publicline/addressMisson/correctionSide',
        name: 'correctionSide',
        meta: { title: '纠偏工单'},
        component: () => import('@/views/workbench/publicline/addressMisson/correctionSide')
      },
      // 统计分析
      {
        path: '/publicline/sumAnalysis',
        name: 'sumAnalysis',
        meta: { title: '统计分析'},
        component: () => import('@/views/workbench/publicline/sumAnalysis')
      },
      // 纠偏工单详情
      {
        path: '/publicline/addressMisson/correctionSideDetail/:id',
        name: 'correctionSideDetail',
        meta: { title: '纠偏工单详情'},
        component: () => import('@/views/workbench/publicline/addressMisson/correctionSide/detail')
      },
      // 工单转派
      {
        path: '/publicline/orderDispatch',
        name: 'orderDispatch',
        meta: { title: '工单转派', isBack: false },
        component: () => import('@/views/workbench/publicline/orderDispatch')
      },
      // 待办待阅
      {
        path: '/publicline/todoToread',
        name: 'todoToread',
        // component: AppLayout,
        meta: { title: '待办待阅', keepAlive: true, isBack: false },
        component: () => import('@/views/workbench/publicline/todoToread')
      },
      {
        path: '/publicline/todoToread/detailOrder/:id',
        // name: '待办待阅详情',
        name: 'todoToreadDetail',
        // component: AppLayout,
        meta: { title: '待办工作' },
        component: () => import('@/views/workbench/publicline/todoToread/detail')
      },
      // 作战情报
      {
        path: '/publicline/town-info',
        meta: { title: '作战情报' },
        component: () => import('@/views/workbench/publicline/board/town-info')
      },
      // 作战情报-三无用户明细
      {
        path: '/publicline/town-info/swdetail',
        meta: { title: '三无用户明细' },
        component: () => import('@/views/workbench/publicline/board/swDetail')
      },
      // 作战情报-移网沉默用户明细
      {
        path: '/publicline/town-info/ywcmdetail',
        meta: { title: '移网沉默用户明细' },
        component: () => import('@/views/workbench/publicline/board/ywcmDetail')
      },
      // 作战情报-5G未登网用户明细
      {
        path: '/publicline/town-info/5gdetail',
        meta: { title: '5G未登网用户明细' },
        component: () => import('@/views/workbench/publicline/board/5gDetail')
      },
      // 作战情报-移网携出预警明细
      {
        path: '/publicline/town-info/xcyjdetail',
        meta: { title: '移网携出预警明细' },
        component: () => import('@/views/workbench/publicline/board/xcyjDetail')
      },
      // 作战情报-移网携出用户明细
      {
        path: '/publicline/town-info/xcyhdetail',
        meta: { title: '移网携出用户明细' },
        component: () => import('@/views/workbench/publicline/board/xcyhDetail')
      },
      // 作战情报-移网离网用户明细
      {
        path: '/publicline/town-info/ywlwdetail',
        meta: { title: '移网离网用户明细' },
        component: () => import('@/views/workbench/publicline/board/ywlwDetail')
      },
      // 作战情报-降套明细
      {
        path: '/publicline/town-info/jtdetail',
        meta: { title: '降套用户明细' },
        component: () => import('@/views/workbench/publicline/board/jtDetail')
      },
      // 作战情报-宽带沉默用户明细
      {
        path: '/publicline/town-info/kdcmdetail',
        meta: { title: '宽带沉默用户明细' },
        component: () => import('@/views/workbench/publicline/board/kdcmDetail')
      },
      // 作战情报-端网业不匹配明细
      {
        path: '/publicline/town-info/dwydetail',
        meta: { title: '端网业不匹配明细' },
        component: () => import('@/views/workbench/publicline/board/dwyDetail')
      },
      // 作战情报-宽带到期预警明细
      {
        path: '/publicline/town-info/kddqdetail',
        meta: { title: '宽带到期预警明细' },
        component: () => import('@/views/workbench/publicline/board/kddqDetail')
      },
      // 作战情报-流失明细
      {
        path: '/publicline/town-info/lsdetail',
        meta: { title: '流失用户明细' },
        component: () => import('@/views/workbench/publicline/board/lsDetail')
      },
      // 作战情报-楼宇明细
      {
        path: '/publicline/town-info/lydetail',
        meta: { title: '楼宇端口预警明细' },
        component: () => import('@/views/workbench/publicline/board/lyDetail')
      },
      // 工资单
      {
        path: '/publicline/payroll',
        meta: { title: '我的工资单' },
        component: () => import('@/views/workbench/publicline/board/payroll')
      },
      // 工资单明细
      {
        path: '/publicline/payroll/detials',
        meta: { title: '工资单明细' },
        component: () => import('@/views/components/publicline/board/payroll-detials')
      },
      // 收入预测
      {
        path: '/publicline/revenue',
        meta: { title: '收入预测' },
        component: () => import('@/views/workbench/publicline/board/revenue')
      },
      // 实时监控 - 移网、固网、携转、智慧家庭、装移修明细
      {
        path: '/publicline/monitor-users',
        meta: { title: '指标明细' },
        component: () => import('@/views/components/publicline/index/monitor-users')
      },
      // 实时监控 - 列表页
      {
        path: '/publicline/monitor-list',
        meta: { title: '实时发展监控' },
        component: () => import('@/views/components/publicline/index/monitor-org-list')
      },
      // 晨会看板
      {
        path: '/publicline/board/morning',
        meta: { title: '晨会看板', keepAlive: true },
        component: () => import('@/views/workbench/publicline/board/morning')
      },
      // 晨会看板 - 收入明细列表
      {
        path: '/publicline/board/income-list',
        meta: { title: '指标明细' },
        component: () => import('@/views/components/publicline/board/incomeList')
      },
      // 晨会看板 - 欠费人员明细列表
      {
        path: '/publicline/board/arrear-list',
        meta: { title: '指标明细' },
        component: () => import('@/views/components/publicline/board/arrearList')
      },
      // 晨会看板 - 欠费用户明细列表
      {
        path: '/publicline/board/arrear-user',
        meta: { title: '用户明细' },
        component: () => import('@/views/components/publicline/board/arrearUser')
      },
      // 夕会看板
      {
        path: '/publicline/board/evening',
        meta: { title: '夕会看板' },
        component: () => import('@/views/workbench/publicline/board/evening')
      },
      // 月看板 - 人员明细
      {
        path: '/publicline/board/monthPersonal',
        meta: { title: '指标明细' },
        component: () => import('@/views/workbench/publicline/board/monthPersonal')
      },
      // 人员明细
      {
        path: '/publicline/board/personal',
        meta: { title: '指标明细' },
        component: () => import('@/views/workbench/publicline/board/personal')
      },
      // 用户明细
      {
        path: '/publicline/board/users',
        meta: { title: '用户明细' },
        component: () => import('@/views/workbench/publicline/board/users')
      },
      // 夕会用户明细
      {
        path: '/publicline/board/eveninguser',
        meta: { title: '用户明细' },
        component: () => import('@/views/workbench/publicline/board/eveningUser')
      },
      // 智家工程师首页
      {
        path: '/publicline/wise/index',
        meta: { title: '智家工程师' },
        component: () => import('@/views/workbench/publicline/wise/index')
      },
      // 积分 - 列表页
      {
        path: '/publicline/wise/integralTotal',
        meta: { title: '积分列表' },
        component: () => import('@/views/workbench/publicline/wise/integralTotal')
      },
      // 积分 - 指标页
      {
        path: '/publicline/wise/integralList',
        meta: { title: '积分明细' },
        component: () => import('@/views/workbench/publicline/wise/integralList')
      },
      // 积分 - 指标明细页
      {
        path: '/publicline/wise/integralDetail',
        meta: { title: '指标明细' },
        component: () => import('@/views/workbench/publicline/wise/integralDetail')
      },
      // 积分 - 指标页 - 新
      {
        path: '/publicline/wise/integralListNew',
        meta: { title: '积分明细' },
        component: () => import('@/views/workbench/publicline/wise/integralListNew')
      },
      // 积分 - 指标明细页 - 新
      {
        path: '/publicline/wise/integralDetailNew',
        meta: { title: '指标明细' },
        component: () => import('@/views/workbench/publicline/wise/integralDetailNew')
      },
      // 薪酬 - 列表页
      {
        path: '/publicline/wise/salary',
        meta: { title: '薪酬列表' },
        component: () => import('@/views/workbench/publicline/wise/salary')
      },
      // 薪酬预测 - 列表页
      {
        path: '/publicline/wise/salaryForecast',
        meta: { title: '薪酬预测' },
        component: () => import('@/views/workbench/publicline/wise/salaryForecast')
      },
      // 薪酬 - 明细页
      {
        path: '/publicline/wise/salaryDetail',
        meta: { title: '薪酬明细' },
        component: () => import('@/views/components/publicline/wise/salaryDetail')
      },
      // 薪酬 - 明细页
      {
        path: '/publicline/wise/salaryDetailNew',
        meta: { title: '薪酬明细' },
        component: () => import('@/views/components/publicline/wise/salaryDetailNew')
      },

      // 卡片列表
      // 通用 - 顶部Banner
      {
        path: '/publicline/card/common/swipe',
        component: () => import('@/views/components/publicline/index/swipe.vue')
      },
      // 通用 - 待办待阅Banner
      {
        path: '/publicline/card/common/todoAndToread',
        component: () => import('@/views/components/publicline/index/todoAndToread.vue')
      },
      // 小CEO - 菜单
      {
        path: '/publicline/card/ceo/menu',
        component: () => import('@/views/components/publicline/index/overview.vue')
      },
      // 小CEO - 菜单
      {
        path: '/publicline/card/ceo/menuwl',
        component: () => import('@/views/components/publicline/index/overviewwl.vue')
      },


      // 首页重构路由----开始
      // 通用 - 发展
      {
        path: '/publicline/card/ceo/develop',
        component: () => import('@/views/components/publicline/index/develop.vue')
      },
      // 通用 - 收入
      {
        path: '/publicline/card/ceo/income',
        component: () => import('@/views/components/publicline/index/income/index.vue')
      },
      // 通用 - 实时监控
      {
        path: '/publicline/card/ceo/realTimeMonitoring',
        component: () => import('@/views/components/publicline/index/realTimeMonitoring.vue')
      },
      // 通用 - 看产能
      {
        path: '/publicline/card/ceo/lookProduction',
        component: () => import('@/views/components/publicline/index/lookProduction.vue')
      },
      // 通用 - 看资源
      {
        path: '/publicline/card/ceo/lookResources',
        component: () => import('@/views/components/publicline/index/lookResources/index.vue')
      },
      // 通用 - 全市营服排名
      {
        path: '/publicline/card/ceo/campUniformRanking',
        component: () => import('@/views/components/publicline/index/campUniformRanking/index.vue')
      },
      {
        path: '/publicline/card/ceo/yfDetailPanel',
        component: () => import('@/views/components/publicline/index/campUniformRanking/yfDetailPanel.vue')
      },

      // 晨会
      {
        path: '/publicline/morning',
        meta: { title: '晨会看板' },
        component: () => import('@/views/workbench/publicline/morning')
      },
      {
        path: '/publicline/morningRec',
        meta: { title: '晨会录制' },
        component: () => import('@/views/workbench/publicline/morningRec')
      },
      // 夕会
      {
        path: '/publicline/evening',
        meta: { title: '夕会看板' },
        component: () => import('@/views/workbench/publicline/evening')
      },
      // 嵌入沙盘系统-派单页面
      // {
      //   path: '/publicline/paidan',
      //   meta: { title: '营销派单' },
      //   component: () => import('@/views/workbench/publicline/pd')
      // },
      {
        path: '/publicline/marketingOrderDispatchStats',
        meta: { title: '营销派单统计' },
        component: () => import('@/views/workbench/publicline/marketingOrderDispatchStats/index')
      },
      {
        path: '/publicline/userLoginStatistics',
        meta: { title: '用户登录统计' },
        component: () => import('@/views/workbench/publicline/userLoginStatistics/index')
      },
      {
        path: '/publicline/taskPage',
        meta: { title: '派单监控' },
        component: () => import('@/views/workbench/publicline/pd')
      },
      {
        path: '/publicline/wgqr',
        meta: { title: '网格嵌入' },
        component: () => import('@/views/workbench/publicline/wgqr')
      },
      {
        path: '/publicline/viewAllWorkOrders',
        meta: { title: '工单看全' },
        component: () => import('@/views/workbench/publicline/viewAllWorkOrders/index')
      },
      // 工单看全-交付工单-二级页面
      {
        path: '/publicline/viewAllWorkOrders/detail/jfgd',
        meta: { title: '交付工单详情' },
        component: () => import('@/views/workbench/publicline/components/viewAllWorkOrders/detail/jfgd')
      },
      // 工单看全-营销工单-二级页面
      {
        path: '/publicline/viewAllWorkOrders/detail/yxgd',
        meta: { title: '营销工单详情' },
        component: () => import('@/views/workbench/publicline/components/viewAllWorkOrders/detail/yxgd')
      },
      // 工单看全-营销工单-三级页面
      {
        path: '/publicline/viewAllWorkOrders/detail/yxgdDetail',
        meta: { title: '营销工单详情' },
        component: () => import('@/views/workbench/publicline/components/viewAllWorkOrders/detail/yxgdDetail')
      },
      // 工单看全-其余工单-二级页面
      {
        path: '/publicline/viewAllWorkOrders/detail/detailTable',
        meta: { title: '营销工单详情' },
        component: () => import('@/views/workbench/publicline/components/viewAllWorkOrders/detail/detailTable')
      },

      // 晨夕会二级页面
      {
        path: '/publicline/morningEvening/detail',
        name: '营业线',
        meta: { title: '营业线' }, // 会动态改变这个title
        // component: () => import('@/views/workbench/publicline/detail/secondPage/index')
        component: () => import('@/views/workbench/publicline/components/morningEvening/secondPage/index')
      },

      // 选择营服
      {
        path: '/publicline/detail/selectGrid',
        name: '选择营服',
        meta: { title: '选择营服' },
        component: () => import('@/views/components/publicline/index/components/selectGrid.vue')
      },

      // 指标详情
      {
        path: '/publicline/morningEvening/indicatorDetails',
        name: '指标详情',
        meta: { title: '指标详情' },
        component: () => import('@/views/workbench/publicline/components/morningEvening/secondPage/components/indicatorDetails')
        // component: () => import('@/views/workbench/publicline/detail/secondPage/components/indicatorDetails')
      },

      // 首页重构路由----结束-------

      // 通用 - 每日看板
      {
        path: '/publicline/card/ceo/dayboard',
        component: () => import('@/views/components/publicline/index/dayboard.vue')
      },
      // 通用 - 实时监控
      {
        path: '/publicline/card/ceo/monitor',
        // component: () => import('@/views/components/publicline/index/monitor.vue')
        component: () => import('@/views/components/publicline/index/realTimeMonitoring.vue')
      },
      // 小CEO - 质态分析
      {
        path: '/publicline/card/ceo/remould',
        component: () => import('@/views/components/publicline/index/remould.vue')
      },
      // 小CEO - 异常告警
      {
        path: '/publicline/card/ceo/warn',
        component: () => import('@/views/components/publicline/index/warn.vue')
      },
      // 智家工程师 - 菜单
      {
        path: '/publicline/card/wise/menu',
        component: () => import('@/views/components/publicline/wise/overview.vue')
      },
      // 智家工程师 - 基础工作
      {
        path: '/publicline/card/wise/baseInfo',
        component: () => import('@/views/components/publicline/wise/baseInfo.vue')
      },
      // 一线 - 积分板块
      {
        path: '/publicline/card/wise/integral',
        component: () => import('@/views/components/publicline/wise/integral.vue')
      },
      // 积分评价
      {
        path: '/publicline/integral/evaluate',
        meta: { title: '积分评价' },
        component: () => import('@/views/workbench/publicline/integral/evaluate.vue')
      },
      // 团队建设
      {
        path: '/publicline/team/list',
        meta: { title: '团队建设' },
        component: () => import('@/views/workbench/publicline/team/list.vue')
      },
      // 团队建设-详情
      {
        path: '/publicline/team/detail',
        meta: { title: '团队建设详细信息' },
        component: () => import('@/views/workbench/publicline/team/detail.vue')
      },

      // 宽带测速 - 任务列表
      {
        path: '/publicline/kdcs/task',
        component: () => import('@/views/workbench/publicline/kdcs/list.vue')
      },
      // 宽带测速模块 - 小区任务
      {
        path: '/publicline/kdcs',
        meta: { title: '四张网建优甩帽' },
        component: () => import('@/views/workbench/publicline/kdcs/layout.vue'),
        children: [
          {
            path: '/publicline/kdcs/community-dk',
            meta: { title: '四张网建优甩帽' },
            component: () => import('@/views/workbench/publicline/kdcs/communityDk.vue')
          },
          {
            path: '/publicline/kdcs/community-page',
            meta: { title: '四张网建优甩帽' },
            component: () => import('@/views/workbench/publicline/kdcs/communityPage.vue')
          },
          {
            path: '/publicline/kdcs/community-swyw',
            meta: { title: '四张网建优甩帽' },
            component: () => import('@/views/workbench/publicline/kdcs/xqSwyw.vue')
          },
          {
            path: '/publicline/kdcs/cs-form',
            meta: { title: '四张网建优甩帽' },
            component: () => import('@/views/workbench/publicline/kdcs/xqcsForm.vue')
          },
          {
            path: '/publicline/kdcs/community-ly-list',
            meta: { title: '四张网建优甩帽' },
            component: () => import('@/views/workbench/publicline/kdcs/xqLyList.vue')
          },
          {
            path: '/publicline/kdcs/community-lyyw',
            meta: { title: '四张网建优甩帽' },
            component: () => import('@/views/workbench/publicline/kdcs/xqLyyw.vue')
          },

          {
            path: '/publicline/kdcs/wjdc-form-new',
            meta: { title: '四张网建优甩帽' },
            component: () => import('@/views/workbench/publicline/kdcs/wjdcForm_new.vue')
          },

          {
            path: '/publicline/kdcs/wjdc-list',
            meta: { title: '四张网建优甩帽' },
            component: () => import('@/views/workbench/publicline/kdcs/wjdcList.vue')
          },

          {
            path: '/publicline/kdcs/wjdc-form',
            meta: { title: '四张网建优甩帽' },
            component: () => import('@/views/workbench/publicline/kdcs/wjdcForm.vue')
          },

          {
            path: '/publicline/kdcs/wysb-build-list',
            meta: { title: '四张网建优甩帽' },
            component: () => import('@/views/workbench/publicline/kdcs/wysbBuildList.vue')
          },

          {
            path: '/publicline/kdcs/wysb-list',
            meta: { title: '四张网建优甩帽' },
            component: () => import('@/views/workbench/publicline/kdcs/wysbList.vue')
          },

          {
            path: '/publicline/kdcs/swly-list',
            meta: { title: '四张网建优甩帽' },
            component: () => import('@/views/workbench/publicline/kdcs/swlyList.vue')
          },

          {
            path: '/publicline/kdcs/swly-gw-form',
            meta: { title: '四张网建优甩帽' },
            component: () => import('@/views/workbench/publicline/kdcs/swlyGwForm.vue')
          },

          {
            path: '/publicline/kdcs/swly-sx-form',
            meta: { title: '四张网建优甩帽' },
            component: () => import('@/views/workbench/publicline/kdcs/swlySxForm.vue')
          },

          {
            path: '/publicline/kdcs/swly-build-list',
            meta: { title: '四张网建优甩帽' },
            component: () => import('@/views/workbench/publicline/kdcs/swlyBuildList.vue')
          },
        ]
      },
      // 工单系统 - 倒三角 ------- start --------
      {
        path: '/order/overview',
        meta: { title: '提诉求' },
        component: () => import('@/views/workbench/order/overview.vue')
      },
      {
        path: '/order/add',
        meta: { title: '新建工单' },
        component: () => import('@/views/workbench/order/add.vue')
      },
      {
        path: '/order/edit',
        meta: { title: '编辑工单' },
        component: () => import('@/views/workbench/order/edit.vue')
      },
      {
        path: '/order/info',
        meta: { title: '工单信息' },
        component: () => import('@/views/workbench/order/info.vue')
      },
      // 工单系统 - 倒三角 ------- end --------
    ]
  },
]
